
import Api from '@/services/api.js'
import moment from 'moment';
const app = getApp();
export default {
  components: {
  },
  data() {
    return {
      list: [],
      dataArr: ['销售订单', '售卖金额', '邀请时间', '邀请奖励'],
      payload: {
        pageNo: 1,
        pageSize: 10
      }
    }
  },
  onLoad(options) {
    this.getTeamMembers();
  },
  onShow() {
  },
  computed: {
    privacyData() {
      return this.$store.state.privacyData;
    }
  },
  async mounted() {
  },
  methods: {
    onRefresh() {
    },
    // 获取团队成员
    async getTeamMembers() {
      const { suc, result } = await this.$request({
        url: Api.getTeamMembers,
        method: 'GET',
        data: {
          ...this.payload,
          userId: this.privacyData.userId,
        }
      })
      if (suc) {
        result.map(i => {
          i.createtime = moment(i.createtime).format('YYYY-MM');
          return i;
        });
        this.list = result;
      }
    }
  },
  onReachBottom() {
  },
  // 下拉刷新
  onPullDownRefresh() {
    this.payload.pageNo = 1;
    this.getTeamMembers();
  }
}